import request from '@/utils/request'

// 查询类别列表
export function listSubject(query) {
  return request({
    url: '/category/subject/list',
    method: 'get',
    params: query
  })
}

export function faultList(faultType,parentId,taskNo) {
  const data = {
    faultType,
    parentId,
    taskNo
  }
  return request({
    url: '/category/subject/faultList',
    method: 'post',
    data: data
  })
}

// 查询类别详细
export function getSubject(deptId) {
  return request({
    url: '/category/subject/' + deptId,
    method: 'get'
  })
}

// 查询类别下拉树结构
export function treeselect() {
  return request({
    url: '/category/subject/treeselect',
    method: 'get'
  })
}

// 新增类别
export function addSubject(data) {
  return request({
    url: '/category/subject',
    method: 'post',
    data: data
  })
}

// 修改类别
export function updateSubject(data) {
  return request({
    url: '/category/subject',
    method: 'put',
    data: data
  })
}

// 删除类别
export function delSubject(deptId) {
  return request({
    url: '/category/subject/' + deptId,
    method: 'delete'
  })
}